package com.shop.entity;

import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * 订单 实体类。
 *
 * @author 彭新才
 * @since 2024-10-14
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "订单")
@Table(value = "shop_order")
public class ShopOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @Id(keyType = KeyType.Auto)
    @Schema(description = "订单id")
    private Long id;

    /**
     * 订单号
     */
    @Schema(description = "订单号")
    private String orderNo;

    /**
     * 商品总金额(不含优惠折扣)
     */
    @Schema(description = "商品总金额(不含优惠折扣)")
    private BigDecimal totalPrice;

    /**
     * 订单金额(含优惠折扣)
     */
    @Schema(description = "订单金额(含优惠折扣)")
    private BigDecimal orderPrice;

    /**
     * 积分抵扣金额
     */
    @Schema(description = "积分抵扣金额")
    private BigDecimal pointsMoney;

    /**
     * 积分抵扣数量
     */
    @Schema(description = "积分抵扣数量")
    private Long pointsNum;

    /**
     * 实际付款金额(包含运费)
     */
    @Schema(description = "实际付款金额(包含运费)")
    private BigDecimal payPrice;

    /**
     * 后台修改的订单金额（差价）
     */
    @Schema(description = "后台修改的订单金额（差价）")
    private BigDecimal updatePrice;

    /**
     * 买家留言
     */
    @Schema(description = "买家留言")
    private String buyerRemark;

    /**
     * 支付方式(10余额支付 20微信支付)
     */
    @Schema(description = "支付方式(10余额支付 20微信支付)")
    private Integer payType;

    /**
     * 支付来源,mp,wx
     */
    @Schema(description = "支付来源,mp,wx")
    private String paySource;

    /**
     * 付款状态(10未付款 20已付款)
     */
    @Schema(description = "付款状态(10未付款 20已付款)")
    private Integer payStatus;

    /**
     * 付款时间
     */
    @Schema(description = "付款时间")
    private Timestamp payTime;

    /**
     * 支付截止时间
     */
    @Schema(description = "支付截止时间")
    private Timestamp payEndTime;

    /**
     * 运费金额
     */
    @Schema(description = "运费金额")
    private BigDecimal expressPrice;

    /**
     * 物流公司id
     */
    @Schema(description = "物流公司id")
    private Long expressId;

    /**
     * 物流公司
     */
    @Schema(description = "物流公司")
    private String expressCompany;

    /**
     * 物流单号
     */
    @Schema(description = "物流单号")
    private String expressNo;

    /**
     * 发货状态(10未发货 20已发货)
     */
    @Schema(description = "发货状态(10未发货 20已发货)")
    private Integer deliveryStatus;

    /**
     * 发货时间
     */
    @Schema(description = "发货时间")
    private Timestamp deliveryTime;

    /**
     * 收货状态(10未收货 20已收货)
     */
    @Schema(description = "收货状态(10未收货 20已收货)")
    private Integer receiptStatus;

    /**
     * 收货时间
     */
    @Schema(description = "收货时间")
    private Timestamp receiptTime;

    /**
     * 订单状态10=>进行中，20=>已经取消，30=>已完成
     */
    @Schema(description = "订单状态10=>进行中，20=>已经取消，30=>已完成")
    private Integer orderStatus;

    /**
     * 赠送的积分数量
     */
    @Schema(description = "赠送的积分数量")
    private Long pointsBonus;

    /**
     * 是否已评价(0否 1是)
     */
    @Schema(description = "是否已评价(0否 1是)")
    private Long isComment;

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    private Long userId;

    /**
     * 供应商id
     */
    @Schema(description = "供应商id")
    private Integer shopSupplierId;

    /**
     * 供应商结算金额,支付金额-平台结算金额
     */
    @Schema(description = "供应商结算金额,支付金额-平台结算金额")
    private BigDecimal supplierMoney;

    /**
     * 平台结算金额
     */
    @Schema(description = "平台结算金额")
    private BigDecimal sysMoney;

    /**
     * 在线支付金额
     */
    @Schema(description = "在线支付金额")
    private BigDecimal onlineMoney;

    /**
     * 退款金额
     */
    @Schema(description = "退款金额")
    private BigDecimal refundMoney;

    /**
     * 支付订单号
     */
    @Schema(description = "支付订单号")
    private String tradeNo;

    /**
     * 是否删除
     */
    @Schema(description = "是否删除")
    private Integer isDelete;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Timestamp createTime;

    /**
     * 更新时间
     */
    @Schema(description = "更新时间")
    private Timestamp updateTime;

}
